Computer controlled graphics systems are used for displaying graphics objects on a display. These graphics objects are composed of graphics primitive elements ("graphics primitives") that include points, lines, polygons, etc. The graphics primitives can be used to render a 2 dimensional (2D) image of a three dimensional (3D) object on a display screen. In the process of rendering 3D graphics, many techniques are used to create realistic 3D effects. Some of these techniques involve Gouruad shading, texture mapping, bilinear filtering, specular lighting and fogging effects. Texture mapping refers to techniques for adding surface detail to areas or surfaces of these 3D graphics objects displayed on a 2D display. Often texture map information is added to displayed polygons.
Generally, texture mapping occurs by accessing encoded surface detail points or "texels" from a texel map memory space ("texel map") which stores the surface detail and transferring the surface detail texels to predetermined points of the graphics primitive to be texture mapped. The process of determining the texels that correspond to pixels is called sampling the texture map. The texture image within a texture map is represented in computer memory as a bitmap or other raster-based encoded format. Texels reside in a (u, v) texture coordinate space. However, the display screen includes point elements (pixels) which reside in an (x, y) display coordinate space. Therefore, texture mapping applies color or visual attributes of texels of the (u, v) texture map to corresponding pixels of the graphics object (primitive) on the display screen. Color values for pixels in (x, y) display coordinate space are determined based on sampled texture map values.
After texture mapping, a version of the texture image is visible on surfaces of the graphics primitive. Because the original graphics object is 3D, texture mapping often involves maintaining certain perspective attributes with respect to the surface detail added to the object. Therefore, the manner in which a texture map is sampled, e.g., by du and dv values, is different depending on the perspective and size of the polygon.
FIG. 1A illustrates a rendering situation in which a relatively large area texel map memory space 10 is used to provide surface detail to a relatively small area polygon 20 of a display screen. In this example, the texel map 10 is in a raster format and contains 512 texels by 512 texels while polygon 20 may contain as few as 10 pixels total. During rendering, because the polygon 20 is relatively small, the texels of the texel map 10 are sampled over large distances to provide the color for the pixels of the displayed polygon 20. This rendering situation typically causes "flickering," also called "sparkling," within the polygon which is shown as lines 25. Sparkling is caused because the rendering process samples different sets of texels from the texel map 10 for successive update frames of the display screen as the polygon 20 may slightly change its perspective between frames. Because the texels are sampled at large distances from each other, any small change in the sample process can cause very differently colored texels to be obtained from frame to frame; this is especially true for texel maps having high color frequency. Displaying the different texel sets causes an animated effect of sparkling within the polygon 20. It is desirable to reduce sparkling within graphics systems to provide more realistic 3D effects. As described further below, mipmapping has been used to reduce sparkling.
FIG. 1B illustrates a rendering situation in which a relatively small area texel map memory space 30 is used to provide surface detail to a larger area polygon 40 of a display screen. In this example, the texel map 30 is in a raster format and contains 10 texels by 10 texels while polygon 40 may have 10 times the area of the texel map 30. Although this situation does not lead to sparkling, as described above, it does lead to "blocky" image quality within polygon 40 reducing its realism. During rendering, because the polygon 40 is so much larger than the texel map 30, the texels of the texel map 30 are subsampled and the result is blocky surface detail 42 displayed within the large polygon 40. As described further below, bilinear filtering has been used to reduce the blocky image quality described above.
In the prior art, the technique of mipmapping has been used to address the problem of sparkling when rendering a polygon in the rendering situation of FIG. 1A. An example of mipmapping is shown in FIG. 2. In effect, mipmapping requires that several different texel maps (called "mipmaps") 51-54 be associated for each texel map 50. The mipmap used depends on the size of the polygon to be rendered. The #0 or original mipmap 50 is the original texel map. Each successive mipmap is then 1/4 the size of its predecessor mipmap. Therefore, #1 mipmap 51 is 1/4 the area of mipmap 50; #2 mipmap 52 is 1/4 the area of mipmap 51; #3 mipmap 53 is 1/4 the area of mipmap 52; and #4 mipmap 54 is 1/4 the area of mipmap 53. As such, mipmap 52 is 1/16 the size of original mipmap 50, mipmap 53 is 1/64 the size of original mipmap 50, and mipmap 54 is 1/256 the size of original mipmap 50. In mipmapping, depending on the relative size of the polygon to be rendered, a different mipmap of 50-54 is selected to perform texel mapping for the polygon. By using a smaller sized mipmap for a small polygon, the distance over which texels are sampled during rendering is reduced thereby reducing sparkling.
Although effective for reducing sparkling in the rendering situation of FIG. 1A, mipmapping has disadvantages. Each mipmap of 50-54 needs to be separately generated by a designer and this generation process is typically manual and/or involves complex and time consuming generation procedures. The mipmaps have to be generated for each original texel map. Further, because multiple mipmaps are required for each original texel map, additional computer memory is consumed (e.g., 33% more memory is required for each texel map) when implementing mipmapping techniques. Therefore, mipmapping restricts the number of unique texel maps that can reside within a graphics computer system. It would be advantageous to provide a technique for reducing or eliminating sparkling without the increased memory consumed by mipmapping techniques.
Bilinear filtering has been used in the past to reduce the blocky appearances of surface detail as described with reference to the rendering situation of FIG. 1B. Bilinear filtering is used as a step in the process of applying texture to polygons. As described below, bilinear filtering involves an average of the nearest neighbor texels of the sampled texels before rendering the polygon. By performing color averaging, the sharp boundaries with blocky appearances, as shown in FIG. 1 B, are reduced or eliminated. Bilinear filtering has not been applied to reduce sparkling in the rendering situation of FIG. 1A.
FIG. 3 illustrates bilinear filtering with an exemplary texel map 60 having a red color portion 60a, a green color portion 60b and a blue color portion 60c. Within texel map 60, three texels are sampled, texel 61, texel 64 and texel 66, to be used in the rendering of respective pixels 73a, 73b and 73c of displayed polygon 71. In bilinear filtering, the color of texel 61 and its nearest neighbors (e.g., adjacent texels) 62a-62d are averaged together to obtain the texel color for respective pixel 73a. Next, the color of texel 66 and its nearest neighbors 65a-65d are averaged to obtain the texel color for respective pixel 73b and the color of texel 66 and its nearest neighbors 67a-67d are averaged to obtain the texel color for respective pixel 73c. In the instance of FIG. 1B where the texel map is subsampled, bilinear filtering is effective at reducing sharp boundaries and blocky appearances.
However, with respect to the rendering situation of FIG. 1A where a large texel map is used for a small polygon, bilinear filtering still causes sparkling because, as shown in FIG. 3, large distances are covered in the texel samples and averaging is performed only with respect to nearest neighbors of the sampled texels. For instance, the red texel 61 is averaged with just reds, the blue texel 66 is averaged with just blue texels and the green texel 64 is averaged with just green texels. Therefore, using bilinear filtering, the high color frequency, that is imposed by the small polygon, is not effectively removed from the polygon and bilinear filtering still leads to a rather high probability of having different texel sets from frame to frame when a low color frequency texel map is used in the rendering situation of FIG. 1A. Therefore, bilinear filtering has not proven to be effective at eliminating sparking effects with respect to the rendering situation of FIG. 1A.